<script lang="ts" setup>
import { useRoute } from 'vue-router'
import { SlashIcon } from 'tdesign-icons-vue-next'
import { computed } from 'vue'

const route = useRoute()
const breadcrumbItems = computed(() => route.matched)
</script>

<template>
  <t-breadcrumb>
    <t-breadcrumbItem v-for="item in breadcrumbItems" :key="item.path" :to="item.path">
      <b>{{ item.meta['title'] }}</b>
    </t-breadcrumbItem>
    <template #separator><SlashIcon /></template>
  </t-breadcrumb>
</template>
